/**
 * 详情对话框
 */
var StudentInfoDlg = {
    data: {
        menuParentId: "",
        menuParentName: ""
    }
};

layui.use(['layer', 'form', 'admin', 'laydate', 'HttpRequest', 'iconPicker', 'address'], function () {
    debugger;
    var $ = layui.jquery;
    var HttpRequest = layui.HttpRequest;
    var form = layui.form;
    var admin = layui.admin;
    var laydate = layui.laydate;
    var address = layui.address;
    var address_area = new address('address', form);
    var register_area = new address('register', form);
    var house_area = new address('house', form);


    var orgId = Feng.getUrlParam('orgId');
    if(orgId === null){
        orgId='';
    }
    var kingresult = new HttpRequest(Feng.ctxPath+'/student/kindergarten?orgId='+orgId,'get');
    var result = kingresult.start();
    debugger
    if (result.data === null){
        result.data ="当前无数据";
    }
    var kingobj = {'ownKindergarten':result.data}
    form.val('studentForm', kingobj);
// 渲染时间选择框
    laydate.render({
        elem: '#birthday'
    });



// 表单提交事件
    form.on('submit(btnSubmit)', function (data) {
        var request = new HttpRequest(Feng.ctxPath + "/student/add", 'post', function (data) {
            Feng.success("添加成功！");

            //传给上个页面，刷新table用
            admin.putTempData('formOk', true);

            //关掉对话框
            admin.closeThisDialog();

        }, function (data) {
            Feng.error("添加失败！" + data.message)
        });
        request.set(data.field);
        request.start(true);

        //添加 return false 可成功跳转页面
        return false;
    });
})
;